#ifndef ADD_CUSTOM_GLYPH_DIALOG_H
#define ADD_CUSTOM_GLYPH_DIALOG_H

#include "ui_AddCustomGlyphDialog.h"
#include <QDialog>
#include <QIntValidator>

class AddCustomGlyphDialog :
    public QDialog
{

    Q_OBJECT;

public:

    AddCustomGlyphDialog( QDialog * parent = 0 );

    const QPixmap & pixmap() const
    {
        return Pixmap;
    }

    QPixmap & pixmap()
    {
        return Pixmap;
    }

    int advance() const
    {
        return UiDialog.advanceSpinBox->value();
    }

    void advance( int value )
    {
        UiDialog.advanceSpinBox->setValue( value );
    }

    int baseline() const
    {
        return UiDialog.baselineSpinBox->value();
    }

    void baseline( int value )
    {
        UiDialog.baselineSpinBox->setValue( value );
    }

    int start() const
    {
        return UiDialog.startSpinBox->value();
    }

    void start( int value )
    {
        UiDialog.startSpinBox->setValue( value );
    }

    int unicode() const
    {
        return UiDialog.unicodeLineEdit->text().toInt();
    }

    void unicode( int value )
    {
        UiDialog.unicodeLineEdit->setText( QString::number( value ) );
    }

private slots:

    void loadBitmap();
    void onDataChange(){ repaint(); }
    void onUnicodeChange();

private:

    void paintEvent( QPaintEvent* );
    
    Ui::AddCustomGlyphDialog
        UiDialog;
    QPixmap
        Pixmap;
    QIntValidator
        IntValidator;

};

#endif
